package demo_6_commonClass;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class date_class {
public static void main(String[] args) throws ParseException {
	Date d=new Date();
	System.out.println(d.getTime());
	SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
	System.out.println(	sdf.format(d));
	
	Calendar c=Calendar.getInstance();
	c.set(1992, 6, 17);
	System.out.println(c.getTime());
	System.out.println(sdf.format(c.getTime()));
	c.add(Calendar.DAY_OF_MONTH, +5);
	System.out.println(c.getTime());
	String str="2010-07-17";
	Date d2=sdf.parse(str);
	System.out.println(sdf.format(d2));
	int maxDate=c.getActualMaximum(Calendar.DATE);
	int minDate=c.getActualMinimum(Calendar.DATE);
	System.out.println(maxDate+" "+minDate);

}
}
